<template>
    <div class="wc-company">
        <!-- <div class="title">普通区</div> -->
        <el-form ref="formdistrict" :model="localForm" label-width="220px" size="small">
            <el-form-item label="区县分佣比" prop="district" required>
                <el-input
                    v-model="localForm.district"
                    class="ls-input"
                    placeholder="区县分佣比"
                    :disabled="$attrs.disabled"
                    >
                    <template slot="append">%</template>
                </el-input>
                <span class="desc">按照用户购买所在地区进行分拥</span>
            </el-form-item>
        </el-form>
        <!-- 复购区 -->

    </div>
    
</template>

<script lang="ts">
// @todo 隐藏时，应该要初始化数据
// 分公司
import {
    Component,
    Prop,
    Ref,
    Vue,
    Watch
} from 'vue-property-decorator'

import { PageMode } from '@/utils/type'

// import LsDialog from '@/components/ls-dialog.vue'

@Component({
    components: {
    }
})

export default class distributionIdentityCompany extends Vue {
    @Prop({
        default() {
            return {}
        }
    }) benefit!: any
    @Prop({ default: PageMode.ADD }) mode!: string


    form:any = {
        district: ''
    }

    localForm:any = {
        district: ''
    }
   
    disabled = false

    @Watch('localForm', {immediate: true, deep: true})
    onLocalCommonOnChange() {
        this.emitEvents()
    }
    @Watch('localRepurchase', {immediate: true, deep: true})
    onLocalRepurchaseOnChange() {
        this.emitEvents()
    }
    created() {
       this.init()
    }

    init() {
        this.localForm.district = this.benefit.district
    }
    emitEvents() {
        this.$emit('update:benefit', {
            district: this.localForm.district
        })
    }
}

</script>

<style lang="scss" scoped>
.wc-company {
    .title {

    }
}
.desc {
    color: #999;
    display: block;
}

</style>
</style>
